<template>
  <div class="relative-position">
    <div class="full-width full-height" id="weather-view-he"></div>
    <div class="absolute" style="width: 350px;height: 248px;top: 0;left: 0;z-index: 5">
      <div class="text-right text-white" style="padding: 20px">
        <div>{{today}}</div>
        <div style="margin-top: 15px">{{week}}</div>
      </div>
    </div>
  </div>
</template>

<script>
import moment from 'moment'
moment.locale('zh-cn')

export default {
  name: 'weather',
  data () {
    return {
      today: moment(new Date()).format('YYYY/MM/DD'),
      week: moment(new Date()).format('dddd')
    }
  },
  created () {
    window.WIDGET = { ID: 'Sl7wHbxIJc' };
    (function (d) {
      var cs = d.createElement('link')
      cs.rel = 'stylesheet'
      cs.href = 'statics/css/tqw_widget_view.css'
      var s = d.createElement('script')
      s.src = 'statics/js/tqw_widget_view.js'
      var sn = d.getElementsByTagName('script')[0]
      sn.parentNode.insertBefore(cs, sn)
      sn.parentNode.insertBefore(s, sn)
    })(document)
    // window.WIDGET = {
    //   CONFIG: {
    //     'layout': 1,
    //     'width': '350',
    //     'height': '248',
    //     'background': 1,
    //     'dataColor': 'FFFFFF',
    //     'borderRadius': '6',
    //     'modules': '10',
    //     'key': '6d5d0ac8e8594430a816ce01491e5739'
    //   }
    // };
    // (function (d) {
    //   var c = d.createElement('link')
    //   c.rel = 'stylesheet'
    //   c.href = 'statics/css/he-standard.css'
    //   var s = d.createElement('script')
    //   s.src = 'statics/js/he-standard.js'
    //   var sn = d.getElementsByTagName('script')[0]
    //   sn.parentNode.insertBefore(c, sn)
    //   sn.parentNode.insertBefore(s, sn)
    // })(document)
  }
}
</script>

<style scoped lang="stylus">
</style>
